package ar.edu.unq.mongodbexample.model;

import java.util.List;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Reference;

/**
 * Representa un Curso. Un curso siempre esta asociado a una materia, tiene un profesor y 1 o mas alumnos
 * 
 * @author Nicolas Faure
 */
@Entity(value="Courses",noClassnameStored=true)
public class Course {

	@Id private int id; 
    private String name;
    @Reference(concreteClass = java.util.Vector.class)
    private List<Student> students;
    @Reference
    private Professor professor;

    public Course() {

    }
    public Course(int id,String name){
    	this.setId(id);
    	this.setName(name);
    }
    public Course(String name){
    	this.setName(name);
    }

    public String getName() {
        return this.name;
    }
    
    public void setName(final String newVal) {
        this.name = newVal;
    }

    public List<Student> getStudents() {
        return this.students;
    }

    public void setStudents(final List<Student> students) {
        this.students = students;
    }

    public Professor getProfessor() {
        return this.professor;
    }

    public void setProfessor(final Professor professor) {
        this.professor = professor;
    }
    
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}

}